from django.db import models

class User(models.Model):
    """用户"""
    user_name = models.CharField(max_length = 32, unique=True)
    password = models.CharField(max_length = 32)
    user_type = models.CharField(max_length = 8,default = "a") # a admin  v vip   u simple user
class Store(models.Model):
    """店铺"""
    store_name = models.CharField(max_length = 32)
    store_user = models.OneToOneField(to = User, on_delete = models.CASCADE)
class GoodsType(models.Model):
    """商品类型"""
    type_name = models.CharField(max_length = 32)
    type_picture = models.ImageField(upload_to ="image")
    def __str__(self):
        return self.type_name


